package gold.digger;

import gold.utils.InputUtil;

/**
 * Created by fanzhenyu02 on 2021/12/10.
 * common problem solver template.
 */
public class LCIT1711 {
    public long startExecuteTime = System.currentTimeMillis();


    class Solution {
        public int findClosest(String[] ws, String a, String b) {
            int n = ws.length, ans = n;
            for (int i = 0, p = -1, q = -1; i < n; i++) {
                String t = ws[i];
                if (t.equals(a)) p = i;
                if (t.equals(b)) q = i;
                if (p != -1 && q != -1) ans = Math.min(ans, Math.abs(p - q));
            }
            return ans;
        }
    }


    public void run() {
        int[] arr = InputUtil.toIntegerArray("[1,2,3]");
        System.out.println(new Solution().toString());
    }

    public static void main(String[] args) throws Exception {
        LCIT1711 an = new LCIT1711();
        an.run();

        System.out.println("\ncurrent solution total execute time: " + (System.currentTimeMillis() - an.startExecuteTime) + " ms.");
    }
}
